<%@ page language="java" contentType="text/html; charset=UTF-8"
    pageEncoding="UTF-8"%>
<script type="text/javascript">
$(function(){
	$("#tabel1").jqGrid({
	 	url	:'../course/list',
	 	editurl:'../course/edit',
		caption	: '课程列表',
		altRows : true,
		autowidth: true,
		width : 1000,
		height : 'auto',
		datatype : 'json',
		mtype : 'post',
		rowNum : 10,
		rowList : [3,5,10,25,50],
		prmNames : { search : 'search'},
		sortname : 'id',
		viewrecords : true,
		pager : '#div1',
		jsonReader : {
			repeatitems : false,
			id : 'id'
		},
		colModel : [
			{name:'id',label:'序号',index:'id',align:'center',width:50,sorttype:'int'},
			{name:'courseName',label:'课程名称',align:'center',index:'courseName',width:150,sorttype:'text',editable:true},
			{name:'courseHour',label:'课时',align:'center',index:'courseHour',width:100,sorttype:'text',editable:true}
		] 
	});
	
	$("#tabel1").jqGrid('navGrid', '#div1', {
			edit : true,
			add : true,
			del : true
		},{
			//改
			top:200,
			left:600
		},{
			//增
			top:200,
			left:600
		},{
			//删
			top:200,
			left:600
		},{
			//查
			top:200,
			left:600,
			sopt: ['eq', 'ne', 'lt', 'le', 'gt', 'ge', 'bw', 'bn', 'in', 'ni', 'ew', 'en', 'cn', 'nc'],
			multipleSearch:true
		});
	});
</script>
	<table id="tabel1"></table>
	<div id="div1"></div>